﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SilverlightBrowserReflectorPlugin
{
    public partial class URLDialog : Form
    {

        private string url;

        public string URL
        {
            get { return url; }
            set { url = value; }
        }

        public URLDialog()
        {
            InitializeComponent();
            this.DialogResult = DialogResult.Cancel;

            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Submit();
        }

        private void Submit()
        {
            this.DialogResult = DialogResult.OK;
            this.url = this.URLText.Text;

            this.Close();
        }

        private void URLText_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                Submit();
            }
        }
    }
}
